package top.ffhome.concurrency.example.singleton;

import top.ffhome.common.annotation.Recommend;
import top.ffhome.common.annotation.ThreadSafe;


@ThreadSafe
@Recommend
public class SingletonExample7 {
    private SingletonExample7() {
    }

    public static SingletonExample7 getInstance() {
        return Singleton.INSTANCE.getInstance();
    }

    private enum Singleton {
        INSTANCE;
        private SingletonExample7 singleton;

        private Singleton() {
            singleton = new SingletonExample7();
        }

        public SingletonExample7 getInstance() {
            return singleton;
        }
    }
}
